package org.igeek.config.bean.ch01;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @package org.igeek.config.ch01
 * @Description
 * @Author LittlePunk [296526219@qq.ccom]
 * @Version 2022.1
 * @Date 2023/11/13 15:09
 */
//@component  组件注解  直接将当前实例加入到ioc容器中  默认使用类名首字母小写作为唯一标识:person
//@Component
public class Person {
    //@value  配置属性值
    @Value("李四")
    private String username;
    @Value("1234")
    private String password;

    public Person() {
    }

    public Person(String username, String password) {
        this.username = username;
        this.password = password;
    }

    /**
     * 获取
     * @return username
     */
    public String getUsername() {
        return username;
    }

    /**
     * 设置
     * @param username
     */
    public void setUsername(String username) {
        this.username = username;
    }

    /**
     * 获取
     * @return password
     */
    public String getPassword() {
        return password;
    }

    /**
     * 设置
     * @param password
     */
    public void setPassword(String password) {
        this.password = password;
    }

    public String toString() {
        return "Person{username = " + username + ", password = " + password + "}";
    }
}
